package com.central.post.controller

import com.central.common.model.CommonResult
import com.central.post.pojo.post.BackPostSaveOrUpdateDto
import com.central.post.service.PostService
import io.swagger.annotations.Api
import io.swagger.annotations.ApiOperation
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.bind.annotation.PostMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController

/**
 * @author  fly
 * @date  2021/5/26 14:55
 * @version 1.0
 */
@Api(tags = ["(管理系统) 帖子模块"])
@RestController
@RequestMapping("back/post")
open class BackPostController {

    @Autowired
    private lateinit var postService: PostService


    @ApiOperation("(后台管理系统) 发布话题贴")
    @PostMapping("/publishTopicPost")
    fun publishTopicPost(backPostSaveOrUpdateDto: BackPostSaveOrUpdateDto, userId: Long): CommonResult<Boolean> =
        postService.publishTopicPost(backPostSaveOrUpdateDto, userId)

}